<template>
  <div>
     <pre>
           //{{underlineToCamel($props.tableName)}}.json.js
        export const  {{underlineToCamel($props.tableName)}}={

             <div v-for="(colitem,index) in ($props.columns||[])">
                 {{underlineToCamel(colitem.colkey||'')}}:'',
             </div>
        }
      </pre>
  </div>
</template>
<script >

function type2tstype(texttype){
 if(texttype=='integer'){
 return 'number'
 }else if(texttype=='text'){
return 'string'
 }
}
function underlineToCamel(str) {
  return str?.replace(/_([a-z])/g, function(match, group1) {
    return group1.toUpperCase();
  });
}
export  default {
  data() {
    return {
      type2tstype,
      underlineToCamel,
    };
  },

  props:{
    columns:{type:[Array]},
    tableName:{type:[String]}
  }
}
</script>
